class UserRole < ActiveRecord::Base

  def  self.add(user_id , role_id)
    sql ="insert into user_roles (user_id , role_id)  values("+user_id+","+role_id+")"
 # puts sql 
     if  ActiveRecord::Base.connection.execute(sql)
       return true
     else
       return false
     end
  end
       
  def self.del(user_id , role_id)
    sql ="delete  from user_roles where  user_id ="+user_id+" and  role_id ="+role_id
    if ActiveRecord::Base.connection.execute(sql)
        return true
    else
        return false
    end
  end
  
end
